﻿namespace Commons.Responses
{
    /// <summary>
    /// 返回集合的时候
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class DatasResponse<T> : MessageResponse where T : class
    {
        public int Total { get; set; }
        public List<T> Datas { get; set; } = new List<T>();
        public DatasResponse() : base() { }
        public DatasResponse(int total) : base()
        {
            this.Total = total;
        }
        public DatasResponse(int total, List<T> datas) : this(total)
        {
            this.Datas = datas;
        }
        public DatasResponse(List<T> datas)
        {
            this.Datas = datas;
            this.Total = datas.Count;
        }
    }
}
